package com.justgame.project.service.system.service.basic;

import com.justgame.project.service.system.entity.SysPlatformInfo;
import com.justgame.project.service.system.query.SysPlatformInfoQuery;
import com.justgame.project.service.system.wrapper.SysPlatformInfoWrapper;
import com.justgame.project.base.servcice.IBasicService;
import org.springframework.util.Assert;
import org.springframework.lang.NonNull;
import java.lang.String;

/**
 *
 * 平台类型信息表服务自定义查询类
 *
 * @@tableName sys_platform_info
 * @author Zwb
 */
@SuppressWarnings("all")
public interface BasicSysPlatformInfoService extends IBasicService<SysPlatformInfoQuery,SysPlatformInfo,SysPlatformInfoWrapper> {

   /**
    * 新增创建
    * @param name 名称
    * @param tag 标记
    */
   default SysPlatformInfo baseAdd(String name, String tag){
      SysPlatformInfo sysPlatformInfo = new SysPlatformInfo();
      sysPlatformInfo.setName(safeValue(name, null));
      sysPlatformInfo.setTag(safeValue(tag, null));
      save(sysPlatformInfo);
      return sysPlatformInfo;
   }

   /**
    * 更新
    * @param name 名称
    * @param tag 标记
    */
   default boolean baseUpdate(@NonNull SysPlatformInfo sysPlatformInfo,String name, String tag){
      Assert.notNull(tag,"必须提供标记");
      Assert.notNull(name,"必须提供名称");
      Assert.notNull(sysPlatformInfo.getId(),"必须提供主键ID");
      sysPlatformInfo.setName(safeValue(name, null));
      sysPlatformInfo.setTag(safeValue(tag, null));
      return updateById(sysPlatformInfo);
   }

}